package cn.com.dhcc.adam.spring.dependency;

public abstract class CommandManager {

	private String commManagerInfo = null;
	Command command;
	public Object process(Object commandState) {
		// grab a new instance of the appropriate Command interface
		 command = createCommand();
		// set the state on the (hopefully brand new) Command instance
		command.setState(commandState);
		return command.execute();
	}
	
	protected abstract Command createCommand();

	public Command getCommand() {
		return command;
	}

	public void setCommand(Command command) {
		this.command = command;
	}

	public String getCommManagerInfo() {
		return commManagerInfo;
	}

	public void setCommManagerInfo(String commManagerInfo) {
		this.commManagerInfo = commManagerInfo;
	}
	
	
}
